package cn.edu.scau.sec.zhangsan.adapter;

import java.util.Calendar;

public class ObjectDotAdapter implements Target{

	@Override
	public void printDate(String calendarString) {
		//将calendarString转换为Calendar类型
		Calendar calendar = Calendar.getInstance();
		
		String[] calendarStrings = calendarString.split("\\.");
		
		calendar.set(Integer.parseInt(calendarStrings[0]), Integer.parseInt(calendarStrings[1]) -1, Integer.parseInt(calendarStrings[2]));
		
		Adaptee adaptee = new Adaptee();
		System.out.println("对象适配器：");
		adaptee.printCalendar(calendar);
	}
}